import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

function hasOneOf(targetarr, arr) {
  return targetarr.some(_ => arr.indexOf(_) > -1)
}

export default new Vuex.Store({
	state: {
		access: []
	},
	mutations: {
		setAccess(state, access) {
			state.access = access;
		},
	},
	actions: {
		getUserInfo({state, commit}) {
			// let data = JSON.parse(localStorage.getItem('ZC_f_user_info')).data.value;
			let data = {};
			return new Promise((resolve, reject) => {
				try {
					commit('setAccess', data);
				} catch(error) {
					reject(error);
				}
			})
		}
	},
	getters: {
		
	}
})
